import { configureStore } from '@reduxjs/toolkit';
import { useSelector, TypedUseSelectorHook, useDispatch } from 'react-redux';
import couterSlice from './modules/counter';
import recommendStore from '@/views/discover/c-views/recommend/store/recommend';
const store = configureStore({
    reducer: {
        couterSlice,
        recommendStore,
    },
});
export type storeType = ReturnType<typeof store.getState>;
export const useAppSelector: TypedUseSelectorHook<storeType> = useSelector;

// dispatch
// export type AppDispatch = typeof store.dispatch;
// export const useAppDispatch = () => useDispatch<AppDispatch>();
type AppDispatch = typeof store.dispatch;
export const useAppDispatch: () => AppDispatch = useDispatch;
export default store;
